package com.bw.coll;

import com.bw.domain.Addre;
import com.bw.service.AddreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class Colla {
    @Autowired
    AddreService dao;
    //查询
    @RequestMapping("/list1")
    public List<Addre> getList1(String addr, String name){
        List<Addre> list1 = dao.getList1(addr, name);
        return list1;
    }
    //添加
    @RequestMapping("/list2")
    public int TjAdd(String uname, String cname, String pwd, String name, String phone,String brithday, String sex, String ctime){
        int i = dao.tjAdd(uname, cname, pwd, name, phone,brithday, sex, ctime);
        System.out.println(i>0?"添加成功":"添加失败");
        return i;
    }
    //删除
    @RequestMapping("/list3")
    public int getList3(Integer[] ids){
        int i = dao.scDele(ids);
        System.out.println(i>0?"删除成功":"删除失败");
        return i;
    }

}
